// literals.cpp
// Customizer_Pro
// Protea Customizer Pro / Business Logic for managing literals
// Copyright (C) 2003, 2004, 2005 eXegeSys, Inc.
// Copyright (C) 2008 Bruce A. James
//
// This program is part of the Protea Project.
//
// The Protea Project is free software; you can redistribute it and/or modify it 
// under the terms of the GNU General Public License as published by the 
// Free Software Foundation, either version 3 of the License, or (at your 
// option) any later version.
//
// The Protea Project is distributed in the hope that it will be useful, but 
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
// for more details.
// 
// You should have received a copy of the GNU General Public License along 
// with this program.  If not, see <http://www.gnu.org/licenses/>.
//
// Please send correspondence to:
//
// theproteaproject@gmail.com
//

#include "pro_customizer.h"

//@ SEC 2
//@ CHA Add Literal Pro
//@ COD AddLiteralPro
//@ NUM 26
//@ CRI LITERAL_NAME
//@ CRI LITERAL
//@ TAB LITERAL_DEFN Write
//
//@ GEN Add Literal will add a literal value for an application
//
TRANSACTION_CODE( AddLiteralPro )
{
	//@ GRS Start the transaction
	START_TXN( AddLiteralPro );
		START_DB_TXN();
			AddLiteralInternal( &txnvars, true );
		END_DB_TXN();

		LOG_TRANSACTION();
	CLEANUP_TXN();
	END_TXN();
	//@ GRE End the transaction
};



//@ CHA Change Literal Pro
//@ COD ChangeLiteralPro
//@ NUM 26
//@ CRI LITERAL_NAME
//@ CRI LITERAL
//@ TAB LITERAL_DEFN Write
//
//@ GEN Change Literal will change literal value for an application
//
TRANSACTION_CODE( ChangeLiteralPro )
{
	//@ GRS Start the transaction
	bool require_log = false;
	START_TXN( ChangeLiteralPro );
		START_DB_TXN();
			require_log = ChgLiteralInternal( &txnvars, true );
		END_DB_TXN();

		if (require_log)
			LOG_TRANSACTION();
	CLEANUP_TXN();
	END_TXN();
	//@ GRE End the transaction
};




//@ CHA Delete Literal Pro
//@ COD DeleteLiteralPro
//@ NUM 27
//@ CRI LITERAL_NAME
//@ TAB LITERAL_DEFN Write
//
//@ GEN Delete Literal will delete a literal definition record
//
TRANSACTION_CODE( DeleteLiteralPro ) 
{
	//@ GRS Start the transaction
	START_TXN( DeleteLiteralPro );
		START_DB_TXN();
			DelLiteralInternal( &txnvars, true );
		END_DB_TXN();

		LOG_TRANSACTION();
	CLEANUP_TXN();
	END_TXN();
	//@ GRE End the transaction
};
